package com.oa.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpSession;

/**
 * @Author Str
 * @Date 2021/12/1 15:50
 * @Description :
 */
@Controller
public class IndexController {
    //    @RequestMapping("/index")
//    public String index(HttpSession session){
//        session.setAttribute("msg","hello");
//        return "index";
//    }
    @RequestMapping("/index")
    public ModelAndView index(HttpSession session) {
        ModelAndView mv = new ModelAndView();
        mv.addObject("msg", "hello");
        mv.setViewName("index");
        return mv;
    }
}
